//
//  PeopleMKAnnotationView.m
//  QT
//
//  Created by 甘世清 on 2025/1/3.
//

#import "PeopleMKAnnotationView.h"

@implementation PeopleMKAnnotationView

- (instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self. bgImage = [[UIImageView alloc]init];
        self.bgImage.layer.cornerRadius = 10;
        self.bgImage.layer.masksToBounds = YES;
        self.bgImage.clipsToBounds = YES;
        self.bgImage.contentMode = UIViewContentModeScaleAspectFill;
        [self addSubview: self.bgImage];
        [ self.bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.centerY.equalTo(self);
            make.width.mas_equalTo(80);
            make.height.mas_equalTo(80);
        }];
    
    }
    return self;
}

- (void)setModel:(PictureModel *)model{
    _model = model;
    
    [self.bgImage sd_setImageWithURL:SQURLImage(model.portrait)
                    placeholderImage:SQGetImage(@"1")];
}
@end
